# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-pecl-timezonedb
_extname=timezonedb
pkgver=2021.5
pkgrel=0
pkgdesc="Timezone Database to be used with PHP's date and time functions."
url="https://pecl.php.net/package/timezonedb"
arch="all"
license="PHP-3.01"
depends="php7-common"
makedepends="php7-dev"
source="https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir/$_extname-$pkgver"
provides="php7-timezonedb=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-timezonedb" # for backward compatibility

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	# Test suite is not a part of pecl release.
	php7 -d extension=modules/$_extname.so --ri $_extname
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php7/conf.d
	install -d $_confdir
	echo "extension=$_extname.so" > $_confdir/40_$_extname.ini
}

sha512sums="
ac295df0dbc833e1b6d452df2fa0a316cc8df95abf6aaf809a87401256c891b9ba0e663dc300e5a0fdf1c0e3566b9eea580eff12ed4d2bcc4355b13eb5893d9e  timezonedb-2021.5.tgz
"
